package com.hao.user.app.model.enums;

/**
 * @author haoge
 * @version 1.0
 * @date 2023/5/21 15:58
 */
public enum GenderEnum {
    MAN(1,"男"),
    WOMAN(0,"女");

    private int value;
    private String gender;

    GenderEnum(int value, String gender) {
        this.value = value;
        this.gender = gender;
    }

    public static GenderEnum getGenderByValue(Integer value) {
        if (value == null) {
            return null;
        }
        GenderEnum[] values = GenderEnum.values();
        for (GenderEnum genderEnum : values) {
            if (genderEnum.getValue() == value) {
                return genderEnum;
            }
        }
        return null;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
}
